//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#ifndef __ELASTOS_INTERRUPT_H__
#define __ELASTOS_INTERRUPT_H__

typedef struct InterruptContext {
    uint32_t    r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12;
    uint32_t    sp, lr, pc, cpsr;
} InterruptContext;

typedef void (CDECL *isr_t)(irq_t, void *, InterruptContext *);

EXTERN void CDECL DzRegisterIsr(irq_t irq, ipl_t ipl, isr_t isr, void *pvDevice);
EXTERN void CDECL DzUnregisterIsr(irq_t irq);

EXTERN void CDECL DzEnableIrq(irq_t irq);
EXTERN void CDECL DzDisableIrq(irq_t irq);

EXTERN ipl_t CDECL DzRaiseCurrentIpl(ipl_t ipl);
EXTERN ipl_t CDECL DzLowerCurrentIpl(ipl_t ipl);

#endif // __ELASTOS_INTERRUPT_H__
